<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增购货入库')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-rukuTest-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">单据编号：</label>
                <div class="col-sm-8">
                    <input name="gouhuoDanhao" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">购货日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="gouhuoDate" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">经手人：</label>
                <div class="col-sm-8">
                    <input name="gouhuoJingshouren" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">仓库：</label>
                <div class="col-sm-8">
                    <select name="gouhuoCangku" id="gouhuoCangku" class="form-control"
                            th:with="type=${@cangkuServiceImpl.selectCangkuAll()}" required>
                        <option th:each="lists : ${type}"
                                th:if="${lists.getCangkuName().equals(session.name4user)
                                        || session.QuanXian=='1'||session.QuanXian==1}"
                                th:text="${lists.getCangkuName()}"
                                th:value="${lists.getCangkuName()}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">商品编号：</label>
                <div class="col-sm-8">
<!--                    th:if="${@goodsServiceImpl.selectGoodsByName(lists.getGoodName())}"-->
                    <input name="goodId" class="form-control" type="text">
                </div>
            </div>
            <!--           <div class="form-group">
                           <label class="col-sm-3 control-label">商品类别：</label>
                           <div class="col-sm-8">
                               <select name="shangpinLeibie" class="form-control"
                                       th:with="type=${@shangpinxinxiServiceImpl.selectGoods4LeiBie()}" required>
                                   <option value=""></option>
                                   <option th:each="lists : ${type}"
                                           th:text="${lists.getShangpinLeibie()}"
                                           th:value="${lists.getShangpinLeibie()}"></option>
                               </select>
                           </div>
                       </div>
                       <div class="form-group">
                           <label class="col-sm-3 control-label is-required">商品名称：</label>
                           <div class="col-sm-8">
                               <input name="goodName" class="form-control" type="text" required>
                           </div>
                       </div>
                       <div class="form-group">
                           <label class="col-sm-3 control-label">商品规格：</label>
                           <div class="col-sm-8">
                               <input name="goodGuige" class="form-control" type="text">
                           </div>
                       </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">数量：</label>
                <div class="col-sm-8">
                    <input name="shuliang" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">单位：</label>
                <div class="col-sm-8">
                    <input name="danwei" class="form-control" type="text">
                </div>
            </div>


            <div class="form-group" th:if="${session.QuanXian == 1}">
                <label class="col-sm-3 control-label">总部底价：</label>
                <div class="col-sm-8">
                    <input name="zongbudijia" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">底价：</label>
                <div class="col-sm-8">
                    <input name="dijia" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">付款方式：</label>
                <div class="col-sm-8">
                    <select name="paymentMethod" class="form-control m-b" th:with="type=${@dict.getType('sys_pay')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <!--<div class="form-group">
                <label class="col-sm-3 control-label is-required">金额：</label>
                <div class="col-sm-8">
                    <input name="jiner" class="form-control" type="text" required>
                </div>
            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="beizhu" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "gouhuoruku/rukuTest"
        $("#form-rukuTest-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-rukuTest-add').serialize());
            }
        }

        $("input[name='gouhuoDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>